<template>
    <div>
        {{ showNum }}
        <button @click="handlerClick">减法</button>
        <button @click="asyncHandlerClick">减法 async</button>
        <button @click="handlerClickN">减法n</button>
        <button @click="asyncHandlerClickN">减法n  异步</button>


    </div>
</template>

<script>
import { mapState,mapMutations,mapActions,mapGetters } from 'vuex'
export default {
    computed: {
        ...mapState(['count']),
        ...mapGetters(['showNum'])
    },
    data() {
        return {

        }
    },
    methods: {
        ...mapMutations(['sub','subN']),
        ...mapActions(['subAsyn','subAsynN']),
        handlerClick(){
            this.sub()
        },
        handlerClickN(){
            this.subN(5)
        },
        asyncHandlerClick(){
            this.subAsyn()
        },
        asyncHandlerClickN(){
            this.subAsynN(8)
        }

    },
    created() {

    },
}
</script>
<style scoped></style>